<template>
	<view class="announcementList">
		<view class="titleBox">
			系统公告
		</view>
		<view class="listItem" v-for="(item,index) in activityList">
			<view class="time">
				{{item.updated_at}}
			</view>
			<view class="content">
				<view class="title">
					{{item.title}}
				</view>
			</view>
		</view>
		<view class="titleBox">
			系统通知 
		</view>
		<view class="listItem" v-for="(item,index) in dataList">
			<view class="time">
				{{item.created_at}}
			</view>
			<view class="content">
				<image :src="item.image" style="width: 670rpx;height: 160rpx;border-radius: 10rpx;margin-top: 10rpx;"
					mode="" mode="aspectFit"></image>
				<view class="title">
					{{item.title}}
				</view>
				<view class="contentnr">
					<u-parse :content="item.content"></u-parse>
				</view>
			</view>
		</view>





		<view class="" style="height: 100rpx;"></view>
	</view>
</template>

<script>
	import {
		systemMessage,
		activity
	} from "@/api/api.js"
	export default {
		data() {
			return {
				dataList: [],
				activityList: [],
			}
		},
		onLoad() {
			this.handleactivity()
			this.handlesystemMessage()
		},
		methods: {
			async handleactivity() {
				let res = await activity()
				this.activityList = res.data
			},

			async handlesystemMessage() {
				let res = await systemMessage()
				this.dataList = res.data
			},
			handleDetail(item) {
				uni.navigateTo({
					url: `./announcementDetail?id=${item.id}`
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.announcementList {
		.titleBox {
			width: 100%;
			text-align: center;
			margin-top: 40rpx;
			font-size: 35rpx;
			font-weight: 600;
		}

		.listItem {
			margin-top: 20rpx;

			.time {
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #CCCCCC;
				line-height: 33rpx;
				width: 100%;
				text-align: center;
			}

			.content {
				width: 100%;
				padding: 20rpx 40rpx;
				box-sizing: border-box;
				background-color: #ffffff;
				margin-top: 20rpx;

				.title {
					font-size: 32rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: bold;
					color: #333333;
					line-height: 38rpx;
					margin-top: 10rpx;
				}

				.contentnr {
					font-size: 28rpx;
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					color: #666666;
					line-height: 50rpx;
					margin-top: 10rpx;
				}
			}
		}
	}
</style>